Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 2 - Control Manager Reference / Control Manager Functions
Embedding Controls /


CountSubControls

NEW WITH THE APPEARANCE MANAGER

Returns the number of embedded controls within a control.

pascal OSErr CountSubControls (
                     ControlHandle inControl,
                     SInt16* outNumChildren);
inControl
On input, a handle to a control whose embedded controls you wish to count.
outNumChildren
On output, a pointer to an integer representing the number of embedded subcontrols.
function result
A result code; see "Result Codes". The result code errControlIsNotEmbedder indicates that the specified control does not support embedding. The result errNoRootControl indicates that embedding is not enabled for that window.
DISCUSSION
The CountSubControls function is useful for iterating over the control hierarchy. You can use the count produced to determine how many subcontrols there are and then call GetIndexedSubControl to get each.

SEE ALSO
"Embedding Controls".

"Appearance Manager Gestalt Selector Constants".


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998